﻿using Ext.Net.MVC;
using Sharp.Portal;
using Sharp.Portal.Mvc.List;
using Sharp.Portal.Other;
using System.Collections.Generic;
using Ext.Net;
using Alignment = Ext.Net.Alignment;
using Column = Ext.Net.MVC.ColumnAttribute;
using NumberColumn = Ext.Net.MVC.NumberColumnAttribute;
using BooleanColumn = Ext.Net.MVC.BooleanColumnAttribute;
using Sharp.Portal.ExtNet;

namespace Sharp.WebBooter.Areas.Workflow.Models
{
    [Title("工作流设计")]
    [DataHandler(ModuleOP.Details, "浏览", 0)]
    [DataHandler(ModuleOP.Create, "新增", 1)]
    [DataHandler(ModuleOP.Edit, "修改", 2)]
    [DataHandler(ModuleOP.Delete, "删除", 3)]
    [DataHandler(ModuleOP.Refresh, "刷新", 4)]
    public class ProcessIndexModel : ExtSharpList
    {
        public ProcessIndexModel()
        {
            this.Feature = ListFeature.MultiSelect | ListFeature.Paging | ListFeature.RowNumber;

        }
        public int Id { get; set; }
        /// <summary>
        /// 流程编号
        /// </summary>
        [Column(Text = "流程编号", Width = 230), QueryOption(Option = QueryFeature.DefualtQuery)]
        public string ProcessGUID { get; set; }
        /// <summary>
        /// 流程名称
        /// </summary>
        [Column(Text = "流程名称", Width = 200)]
        public string ProcessName { get; set; }
        /// <summary>
        /// 版本
        /// </summary>
        [Column(Text = "版本", Width = 80)]
        public string Version { get; set; }
        /// <summary>
        /// 禁用
        /// </summary>
        [BooleanColumn(Text = "禁用", TrueText = "禁用", FalseText = "正常", Align = Alignment.Center)]
        public bool IsUsing { get; set; }

        [Column(Text = "设计", Width = 200, RendererHandler = "function(value, cellmeta, record, rowIndex, columnIndex, store){ return new ProcessViewModel().link(value, cellmeta, record, rowIndex, columnIndex, store)}", Align = Alignment.Center)]
        public string Link { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        [Column(Text = "描述", Flex = 1)]
        public string Description { get; set; }
    }
}